@extends('app')

@section('content')
<div class="layui-card" style="height:100vh;">
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                @component('form.form',['id'=>'form'])
                    @include('form.select',[
                           'label'      => '角色',
                           'name'       => 'role_id',
                           'class'      => 'layui-col-md12',
                           'style'      => 'primary',
                           'checked'    => $model->role_id??'',
                           'val'        => $role
                       ])

                    @include('form.input',[
                           'label' => '昵称',
                           'name'  => 'nickname',
                           'class' => 'layui-col-md12',
                           'val'   => $model->nickname??''
                       ])

                    @include('form.input',[
                           'label' => '登录账户',
                           'name'  => 'username',
                           'class' => 'layui-col-md12',
                           'val'   => $model->username??''
                       ])

                    @include('form.input',[
                           'label' => '邮箱',
                           'name'  => 'email',
                           'must'  => false,
                           'class' => 'layui-col-md12',
                           'val'   => $model->email??''
                       ])

                    @if(empty($id))
                        @include('form.password',[
                               'label'          => '密码',
                               'name'           => 'password',
                               'class'          => 'layui-col-md12',
                               'placeholder'    => '6到16个字符',
                               'val'            => $model->password??''
                           ])

                        @include('form.password',[
                               'label' => '确认密码',
                               'name'  => 'password_confirmation',
                               'class' => 'layui-col-md12',
                               'val'   => $model->password_confirmation??''
                           ])
                    @endif

                    @include('form.submit',['label'=>'立即提交','form'=>'form'])
                @endcomponent
            </div>
        </div>
    </div>
</div>
@endsection